import os, sys

if sys.platform == 'linux2' or sys.platform == 'linux-i386':
	## do linux build

	main_70_obj = SharedObject('main_70', 'main.cpp', CPPPATH = ["/usr/aw/maya7.0/include/"], CPPDEFINES=Split('LINUX _BOOL'))
	main_80_obj = SharedObject('main_80', 'main.cpp', CPPPATH = ["/usr/aw/maya8.0/include/"], CPPDEFINES=Split('LINUX _BOOL'))
	
	SharedLibrary('sunflow_70', main_70_obj, LIBS = Split("Foundation OpenMaya"), LIBPATH = ["/usr/aw/maya7.0/lib/"])
	SharedLibrary('sunflow_80', main_80_obj, LIBS = Split("Foundation OpenMaya"), LIBPATH = ["/usr/aw/maya8.0/lib/"])
else:
	# Compiler system environment paths.
	sdk_base="C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\\"
	
	c_path ="%s\\Bin\\win64\\x86\\AMD64;"  % (sdk_base)
	c_incl ="%s\\Include;%s\\INCLUDE\\crt" % (sdk_base, sdk_base)
	c_lib  ="%s\\Lib\\AMD64;"              % (sdk_base)
	
	# Common compiler switches for debug, release and profile environments:
	# /nologo   No version and name banner.
	# /W3       Warning level.
	# /WX       Treat warnings as errors.
	# /GR       Enable RTTI.
	# /EHsc     Enable exception handling.
	# /MT       Use multi-threaded run-time libraries (statically linked into the exe). Defines _MT.
	# /O2       Fastest possible code.
	# /Ox       Maximum optimizations
	common_CXXFLAGS = '/nologo /W3 /WX /GR /EHsc /MT /O2 /Ox'
	
	# Common link switches for both debug and release builds:
	common_LINKFLAGS = '/nologo /incremental:no /MACHINE:AMD64'
	
	# Compiler switches for release builds:
	envRelease = Environment(CCFLAGS    = common_CXXFLAGS,
	                         CPPDEFINES = Split('_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE'),
	                         LINKFLAGS  = common_LINKFLAGS)
	
	envRelease['ENV']['PATH'] = c_path
	envRelease['ENV']['INCLUDE'] = c_incl
	envRelease['ENV']['LIB'] = c_lib
	
	main_80_obj = envRelease.SharedObject('main_70', 'main.cpp', CPPPATH = ["C:\\Program Files\\Alias\\Maya8.0\\include"]   , CPPDEFINES=Split('NDEBUG WIN32 _WINDOWS NT_PLUGIN REQUIRE_IOSTREAM Bits64_'))
	main_85_obj = envRelease.SharedObject('main_80', 'main.cpp', CPPPATH = ["C:\\Program Files\\Autodesk\\Maya8.5\\include"], CPPDEFINES=Split('NDEBUG WIN32 _WINDOWS NT_PLUGIN REQUIRE_IOSTREAM Bits64_'))

	envRelease.SharedLibrary('sunflow_80',
	                         main_80_obj,
	                         SHLIBSUFFIX='.mll',
	                         LIBS=Split("Foundation OpenMaya bufferoverflowU"),
	                         LIBPATH=["C:\\Program Files\\Alias\\Maya8.0\\lib"],
	                         LINKFLAGS=Split('/export:initializePlugin /export:uninitializePlugin'))
	envRelease.SharedLibrary('sunflow_85',
	                         main_85_obj,
	                         SHLIBSUFFIX='.mll',
	                         LIBS=Split("Foundation OpenMaya bufferoverflowU"),
	                         LIBPATH=["C:\\Program Files\\Autodesk\\Maya8.5\\lib"],
	                         LINKFLAGS=Split('/export:initializePlugin /export:uninitializePlugin'))
